import React, { useState } from 'react'
import { NavLink, Outlet } from "react-router-dom"
export default function Messg() {
    let [list] = useState([
        { id: "1", title: "jt", messg: '今天' },
        { id: "2", title: "mt", messg: '明天' },
        { id: "3", title: "ht", messg: '后天' },
    ])
    return (
        <div>Messg
            <ul>
                {/* 路由serach传参 */}
                {/* {list.map((item) => <li key={item.id}><NavLink to={`acc?id=${item.id}&title=${item.title}&messg=${item.messg}`}>{item.title}</NavLink></li>)} */}
                {/* 路由query传参 */}
                {list.map((item) => <li key={item.id}><NavLink to={`acc/${item.id}/${item.title}/${item.messg}`}>{item.title}</NavLink></li>)}
            </ul>
            <Outlet></Outlet>
        </div>

    )
}
